export function setStorage(key, value, time = 0) {
	const data = {
		data: value
	};
	if (time > 0) {
		data.expiration = (Date.now() / 1000).toFixed() * 1 + time * 1;
	}
	uni.setStorageSync(key, data);
}
export function getStorage(key) {
	const nowDate = (Date.now() / 1000).toFixed() * 1;
	const data = uni.getStorageSync(key) ? uni.getStorageSync(key) : false;
	if (data.expiration) {
		if (nowDate > data.expiration) {
			removeStorage(key);
			return null;
		}
	}
	return data.data;
}
export function removeStorage(key) {
	uni.removeStorageSync(key)
}
export function clearStorage() {
	uni.clearStorageSync();
}